package ar.com.solidussource.howmuchmobile.activities.menu;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import ar.com.solidussource.howmuchmobile.R;
import ar.com.solidussource.howmuchmobile.activities.list.AddressSearchGeocoderActivity;
import ar.com.solidussource.howmuchmobile.activities.list.ProvinceListActivity;
import ar.com.solidussource.howmuchmobile.activities.generic.BaseActivity;

/**
 * Created with IntelliJ IDEA.
 * User: FT31270775
 * Date: 06/11/12
 * Time: 14:58
 * To change this template use File | Settings | File Templates.
 */
public class UbicacionMenu extends BaseActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = (View) inflater.inflate(R.layout.ubicacion_menu, null);

        final String[] datos = new String[]{"Manual","GPS"};

        ArrayAdapter<String> adaptador = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, datos);

        ListView lstOpciones = (ListView)v.findViewById(R.id.menuList);

        lstOpciones.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> a, View v, int position, long id) {
                if(position == 0){
                    Intent intent = new Intent(UbicacionMenu.this, AddressSearchGeocoderActivity.class);
                    //intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                    startActivity(intent);
                }
                if(position == 1){
                    //Intent intent = new Intent(MainMenuActivity.this, CotizacionesActivity.class);
                    //startActivity(intent);
                }
            }
        });

        lstOpciones.setAdapter(adaptador);

        setContent(v);
    }
}